
*Table 1
clear all 
use "...\Matched model data.dta" 
eststo: fracreg logit share_PQ MPs2008 [iw= weights], or
eststo: fracreg logit share_PQ MPs2008 districtmag04 Electoral_sec_std Local_exp imposed04 partychange04  years_parl04  years_party04  i.partyposition04 PPG_leader Vote_Presence govparty04 gender  [iw= weights], or
eststo: fracreg logit share_infra MPs2008 districtmag04 Electoral_sec_std Local_exp imposed04 partychange04  years_parl04  years_party04  i.partyposition04 PPG_leader Vote_Presence govparty04 gender  [iw= weights], or
eststo: fracreg logit share_case MPs2008 districtmag04 Electoral_sec_std Local_exp imposed04 partychange04  years_parl04  years_party04  i.partyposition04 PPG_leader Vote_Presence govparty04 gender [iw= weights], or
eststo: fracreg logit share_event MPs2008 districtmag04 Electoral_sec_std Local_exp imposed04 partychange04  years_parl04  years_party04  i.partyposition04 PPG_leader Vote_Presence govparty04 gender [iw= weights], or
eststo: fracreg logit share_business MPs2008 districtmag04 Electoral_sec_std Local_exp imposed04 partychange04  years_parl04  years_party04  i.partyposition04 PPG_leader Vote_Presence govparty04 gender [iw= weights], or
eststo: fracreg logit share_org MPs2008 districtmag04 Electoral_sec_std Local_exp imposed04 partychange04  years_parl04  years_party04  i.partyposition04 PPG_leader Vote_Presence govparty04 gender [iw= weights], or
esttab, eform  star(* 0.10 ** 0.05 *** 0.01)  b(a3) not pr2 plain aic bic scalars("ll Log lik." "chi2 Chi-squared")

*Figure 3
fracreg logit share_infra MPs2008 districtmag04 Electoral_sec_std Local_exp imposed04 partychange04  years_parl04  years_party04  i.partyposition04 PPG_leader Vote_Presence govparty04 gender  [iw= weights], or
margins, at(MPs2008=(0 1)) vsquish
marginsplot, recast(scatter)
fracreg logit share_business MPs2008 districtmag04 Electoral_sec_std Local_exp imposed04 partychange04  years_parl04  years_party04  i.partyposition04 PPG_leader Vote_Presence govparty04 gender [iw= weights], or
margins, at(MPs2008=(0 1)) vsquish
marginsplot, recast(scatter)

*Table 2 
*2005-2006
clear all 
use "...\Pooled model data.dta" 
eststo: glm share_PQ districtmag04 Electoral_sec_std Local_exp imposed04 partychange04  years_parl04  years_party04  i.partyposition04 PPG_leader Vote_Presence govparty04  gender if party08==., link(logit) family(binomial) robust
eststo: glm share_PQ districtmag04 Electoral_sec_std Local_exp imposed04 partychange04  years_parl04  years_party04  i.partyposition04 PPG_leader Vote_Presence govparty04  gender i.party04 if party08==., link(logit) family(binomial) robust
*2009-2010
eststo: glm share_PQ districtmag04 Electoral_sec_std Local_exp imposed04 partychange04  years_parl04  years_party04  i.partyposition04 PPG_leader Vote_Presence govparty04  gender if party04==., link(logit) family(binomial) robust
eststo: glm share_PQ districtmag04 FPTP Electoral_sec_std Local_exp imposed04 partychange04  years_parl04  years_party04  i.partyposition04 PPG_leader Vote_Presence govparty04 gender i.party08 if party04==., link(logit) family(binomial) robust
esttab, eform  star(* 0.10 ** 0.05 *** 0.01)  b(a3) not pr2 plain aic bic scalars("ll Log lik." "chi2 Chi-squared")

*Figure 4
*2005-2006
glm share_PQ districtmag04 Electoral_sec_std Local_exp imposed04 partychange04  years_parl04  years_party04  i.partyposition04 PPG_leader Vote_Presence govparty04  gender i.party04 if party08==., link(logit) family(binomial) robust
margins, at(districtmag04=(4 6 8 10 12 28)) vsquish
marginsplot
*2009-2010
glm share_PQ districtmag04 FPTP Electoral_sec_std Local_exp imposed04 partychange04  years_parl04  years_party04  i.partyposition04 PPG_leader Vote_Presence govparty04 gender i.party08 if party04==., link(logit) family(binomial) robust
margins, at(districtmag04=(4 6 8 10 12 28)) vsquish
marginsplot

*Models Table A2.1
use "...\Pooled model data.dta" 
eststo: glm share_infra districtmag04 Electoral_sec_std Local_exp imposed04 partychange04 years_parl04  years_party04  i.partyposition04 PPG_leader Vote_Presence govparty04  gender i.party04 if party08==., link(logit) family(binomial) robust
eststo: glm share_case districtmag04 Electoral_sec_std Local_exp imposed04 partychange04 years_parl04  years_party04  i.partyposition04 PPG_leader Vote_Presence govparty04  gender i.party04 if party08==., link(logit) family(binomial) robust
eststo: glm share_event districtmag04 Electoral_sec_std Local_exp imposed04 partychange04  years_parl04  years_party04  i.partyposition04 PPG_leader Vote_Presence govparty04  gender i.party04 if party08==., link(logit) family(binomial) robust
eststo: glm share_business districtmag04 Electoral_sec_std Local_exp imposed04 partychange04  years_parl04  years_party04  i.partyposition04 PPG_leader Vote_Presence govparty04  gender i.party04 if party08==., link(logit) family(binomial) robust
eststo: glm share_org districtmag04 Electoral_sec_std Local_exp imposed04 partychange04  years_parl04  years_party04  i.partyposition04 PPG_leader Vote_Presence govparty04  gender i.party04 if party08==., link(logit) family(binomial) robust
esttab, eform star(* 0.10 ** 0.05 *** 0.01)  b(a3) not pr2 plain aic bic scalars("ll Log lik." "chi2 Chi-squared")

*Models Table A2.2
eststo: glm share_infra districtmag04 Local_exp imposed04 years_parl04 years_party04 Electoral_sec_std FPTP partychange04 i.partyposition04 PPG_leader Vote_Presence govparty04 gender i.party08 if party04==., link(logit) family(binomial) robust
eststo: glm share_case districtmag04 Local_exp imposed04 years_parl04 years_party04 Electoral_sec_std FPTP partychange04 i.partyposition04 PPG_leader Vote_Presence govparty04 gender i.party08 if party04==., link(logit) family(binomial) robust
eststo: glm share_event districtmag04 Local_exp imposed04 years_parl04 years_party04 Electoral_sec_std FPTP partychange04 i.partyposition04 PPG_leader Vote_Presence govparty04 gender i.party08 if party04==., link(logit) family(binomial) robust
eststo: glm share_business districtmag04 Local_exp imposed04 years_parl04 years_party04 Electoral_sec_std FPTP partychange04 i.partyposition04 PPG_leader Vote_Presence govparty04 gender i.party08 if party04==., link(logit) family(binomial) robust
eststo: glm share_org districtmag04 Local_exp imposed04 years_parl04 years_party04 Electoral_sec_std FPTP partychange04 i.partyposition04 PPG_leader Vote_Presence govparty04 gender i.party08 if party04==., link(logit) family(binomial) robust
esttab, eform star(* 0.10 ** 0.05 *** 0.01)  b(a3) not pr2 plain aic bic scalars("ll Log lik." "chi2 Chi-squared")
